<div class="HomeSlogan">Experience the power of expression</div>
<div id="errorMsg"><?php echo $ctx->message;?></div>
<form id="loginform" class="form" name="loginform" method="POST" action="/home/index/login">
<div class="Homelogin">
<input type="text" value="Email" name="email" id="email" onfocus="clearField(this.id,'Email');" onblur="addValuetoField(this.id,'Email');"/>
<input type="password" value="Password" name="password"  id="password" onfocus="clearField(this.id,'Password');" onblur="addValuetoField(this.id,'Password');" />
<span  style="display:none;" id="cpass">
<input type="password" value="Confirm Password" name="cnfpass" id="cnfpass"/></span>
<div style="padding:5px 0 0 20px;" id="loginButton">
<a class="Button" href="javascript:void(0);" onclick="validate_login();"><span>Sign In</span></a>
<div class="Fleft pad_t5"><a href="/home/index/register" class="fontgrey txt_sm" >Register</a> |<a href="/home/index/forgot-password" class="fontgrey txt_sm"> Forgot Password ?</a></div>
</div>
<div style="padding:5px 0 0 20px;display:none;" id="registerButton">
<a class="Button" href="/home/index/register"><span>Register</span></a>
</div>
<div class="clear"></div>
</div>
</form>
  <script type="text/javascript">
  function clearField(id,itemvalue)
{
	if($("#"+id).val()==itemvalue){
		$("#"+id).val('');
	}
}
function addValuetoField(id,itemvalue)
{
	if($("#"+id).val()==''){
		$("#"+id).val(itemvalue);
	}
}
  function validate_login()
{

	if($('#email').val()==''|| $('#email').val()=='Email')
	{
		alert("${php: this.translate('errmsg_comment')}");
		return false;
	}
	if($('#password').val()==''||$('#password').val()=='Password')
	{
		alert("${php: this.translate('enter_password')}");
		return false;
	}
	if($('#email').val()!='')
	{
			if(!isValidEmailAddress($('#email').val()))
				{
				alert('Please enter valid email address');
					return false;
				} 
			

	}
	$('#loginform').submit();
	//return result;
}
function register(val)
{
	//alert('hi');
	if(val == 0)
	{
		$('#cpass').show();
		$('#registerButton').show();
		$('#loginButton').hide();
	} else {
		$('#cpass').hide();
		$('#loginButton').show();
		$('#registerButton').hide();
	}
}
  
  
  </script>